// 把创建的jsonp方法引入进来
import jsonp from 'common/js/jsonp'
// 常用的参数引入进来
import {commonParams, options} from './config'
// 输出getSingerList方法
export function getSingerList () {
  // 地址
  const url = 'https://c.y.qq.com/v8/fcg-bin/v8.fcg'

  // 参数
  const data = Object.assign({}, commonParams, {
    channel: 'singer',
    page: 'list',
    key: 'all_all_all',
    pagesize: 100,
    pagenum: 1,
    hostUin: 0,
    needNewCode: 0,
    platform: 'yqq'
  })

  return jsonp(url, data, options)
}

// 输出getSingerDetail方法,就是获取歌手歌曲详情页
export function getSingerDetail (singerId) {
  const url = 'https://c.y.qq.com/v8/fcg-bin/fcg_v8_singer_track_cp.fcg'

  const data = Object.assign({}, commonParams, {
    hostUin: 0,
    needNewCode: 0,
    platform: 'yqq',
    order: 'listen',
    begin: 0,
    num: 80,
    songstatus: 1,
    singermid: singerId
  })

  return jsonp(url, data, options)
}
